package com.grape.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.grape.dao.BookmarkRepository;
import com.grape.pojo.Bookmark;
import com.grape.service.BookmarkService;

@Service
@Transactional
public class BookmarkServiceImpl implements BookmarkService {
	
	@Autowired
	private BookmarkRepository br;
	
	@Override
	public void editBookmark(Bookmark model) {
		Bookmark bookmark = br.findOne(model.getId());
		bookmark.setBname(model.getBname());
		bookmark.setUrl(model.getUrl());
	}

	@Override
	public void delBookmark(Integer id) {
		Bookmark bookmark = br.findOne(id);
		bookmark.setBookmark_box(null);
		br.delete(bookmark);	
		
	}
	
	
}
